﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ProcedureList.Library.UI;
using ProcedureList.Library.Presenters;
using System.IO;

namespace ProcedureList.TestUI
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public static string FileToString(string FileName)
        {
            using (FileStream fs = new FileStream(FileName, FileMode.Open))
            {
                using (StreamReader sr = new StreamReader(fs))
                {
                    return sr.ReadToEnd();
                }
            }
        }


        private void Form1_Load(object sender, EventArgs e)
        {
          
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var view = new FormProcedureList();
            var presenter = new ProcedureListPresenter(view, FileToString(@"z:\Dev\Play\C#\Patterns\IoC\ACSR.Core.Patterns.IoC\Patterns\IoC\LifeCycles.cs"));
            presenter.Load();
            view.ShowDialog();

            Console.WriteLine(view.SelectedMethod.Position);
        }
    }
}
